import request from '@/utils/request'

export default {

  //1.增加课程信息
  getChapterAndVideo(courseId) {
    return request({
      url: `/chapter/get/all/${courseId}`,
      method: 'get'
    })
  },

  //2.添加章节
  addChapter(chapter) {
    return request({
      url: `/chapter/add`,
      method: 'post',
      data: chapter
    })
  },

  //3.根据章节Id查询章节
  getChapter(chapterId) {
    return request({
      url: `/chapter/get/${chapterId}`,
      method: 'get'
    })
  },

  //4.修改章节
  editChapter(chapter) {
    return request({
      url: `/chapter/update`,
      method: 'post',
      data: chapter
    })
  },

  //5.根据章节Id删除章节
  deleteChapter(chapterId) {
    return request({
      url: `/chapter/delete/${chapterId}`,
      method: 'delete'
    })
  },

}
